package es.cea.web;

public class Stat implements Comparable<Stat> {


	public String url;
	public int contador;
	
	public Stat(){
		url = "";
		contador = 0;
	}
	
	public Stat(String url, int contador){
		this.url = url;
		this.contador = contador;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Stat other = (Stat) obj;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "[url=" + url + ", contador=" + contador + "]";
	}

	@Override
	public int compareTo(Stat arg0) {
		// TODO Auto-generated method stub
		return arg0.contador - this.contador;
	}
	
	
	
	
	
}
